<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <p>模板语法</p>
      <!-- v-once表示这个元素只会被渲染一次 -->
      <p v-once>{{ count }}</p>
      <p>{{ count }}</p>
      <!-- v-html将内容转成html标签进行渲染 -->
      <div v-html="content"></div>
      <!-- v-text相当于直接写双大括号 -->
      <div v-text="content"></div>

      <input type="text" :disabled="done" />

      <img v-bind:[attr]="url" alt="" />
    </div>

    <script src="../Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          count: 1,
          content: "<h1>标题</h1>",
          done: false,
          url: "xxxx",
          attr: "src",
        },
        mounted() {
          setInterval(() => {
            this.count++;
          }, 1000);
        },
      });
    </script>
  </body>
</html>
